package com.cjet.nissan.room

import androidx.room.Entity
import androidx.room.PrimaryKey
import com.cjet.nissan.R

@Entity(tableName = "user_collect_table")
data class NTDS(
       @PrimaryKey(autoGenerate = true)
       var id: Long = 0L,
       val time: Long = System.currentTimeMillis(),
       var value: Int = -1,
       var type: Int = 0, // 0 Heart Rate  1 Respiratory Rate  2Emotional State
       var ext1:String="",
       var ext2:String="",
       var ext3:String="",
){

       //只有tpye为2的时候，才可以是获取到对应的
       // Happy,Surprise,Neutral,Sad,Disgust,Fear,Angry
       //获取对应的显示图片
       fun getEmojiPic():Int{
            return when(value){
                   EmojiStata.Happy.ordinal-> R.mipmap.icon_emoji_happy
                   EmojiStata.Surprise.ordinal->R.mipmap.icon_emoji_surprise
                   EmojiStata.Neutral.ordinal->R.mipmap.icon_emoji_neutral
                   EmojiStata.Sad.ordinal->R.mipmap.icon_emoji_sad
                   EmojiStata.Disgust.ordinal->R.mipmap.icon_emoji_disgust
                   EmojiStata.Fear.ordinal->R.mipmap.icon_emoji_fear
                   EmojiStata.Angry.ordinal->R.mipmap.icon_emoji_angry
                   else-> -1
            }


       }






}
